const formatTime = date => {
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const day = date.getDate()
  const hour = date.getHours()
  const minute = date.getMinutes()
  const second = date.getSeconds()

  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}

const formatNumber = n => {
  n = n.toString()
  return n[1] ? n : '0' + n
}

const filterFormatAmt = (input) => {
  let afterStr = "";
  if (input) {
    if (String(Number(input)).indexOf('.') == -1) {
      afterStr = Number(input);
    } else {
      afterStr = Number(input).toFixed(2);
    }
  } else {
    afterStr = '';
  }
  return afterStr;
}

const formatDate = (startTime)=>{
  //当前时间与2017-04-04的时间差
  // let startTime = "20171225093900";
  let formatDateStr = startTime.substring(0, 4) + "/" + startTime.substring(4, 6) + "/" + startTime.substring(6, 8) + " " + startTime.substring(8, 10) + ":" + startTime.substring(10, 12) + ":" + startTime.substring(12, 14);
  let startDate = new Date(formatDateStr);
  let endDate = new Date();
  let diff = endDate.getTime() - startDate.getTime();//时间差的毫秒数  

  //计算出相差天数  
  let days = Math.floor(diff / (24 * 3600 * 1000));

  //计算出小时数  
  let leave1 = diff % (24 * 3600 * 1000);    //计算天数后剩余的毫秒数  
  let hours = Math.floor(leave1 / (3600 * 1000));
  //计算相差分钟数  
  let leave2 = leave1 % (3600 * 1000);        //计算小时数后剩余的毫秒数  
  let minutes = Math.floor(leave2 / (60 * 1000));

  //计算相差秒数  
  let leave3 = leave2 % (60 * 1000);      //计算分钟数后剩余的毫秒数  
  let seconds = Math.round(leave3 / 1000);
  let returnStr = "刚刚";
  if (minutes > 0) {
    returnStr = minutes + "分钟前";
  }
  if (hours > 0) {
    returnStr = hours + "小时前";
  }
  if (days > 0) {
    if (days == 1) {
      returnStr = "昨天";
    } else if (days == 2) {
      returnStr = "前天";
    } else {
      returnStr = startTime.substring(0, 4) + "-" + startTime.substring(4, 6) + "-" + startTime.substring(6, 8);
    }
  }
  return returnStr;
}

const sortByTime = (tempList)=> {
  var map = {},dest = [];
  for (var i = 0; i < tempList.length; i++) {
    var ai = tempList[i];
    if (!map[ai.time.substring(0, 8)]) {
      dest.push({
        initial: ai.time,
        busInfoList: [ai]
      });
      map[ai.time.substring(0, 8)] = ai;
    } else {
      for (var j = 0; j < dest.length; j++) {
        var dj = dest[j];
        if (dj.initial.substring(0, 8) == ai.time.substring(0, 8)) {
          dj.busInfoList.push(ai);
          break;
        }
      }
    }
  }
  return dest;
}
// 邮箱验证
const fChkMail = (mail) => {
  var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
  return reg.test(mail);
}

// 手机号验证
const isValidNo = (mobileNo) => {
  var v = false;
  if (mobileNo == null || mobileNo == "" || mobileNo.length != 11) {
    return false;
  }
  var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(18[0-9]{1})|(14[0-9]{1}))+\d{8})$/;
  if (myreg.test(mobileNo)) {
    v = true;
  }
  return v;
}

//时间格式化
const timetrans = (date, dayOrTime) =>{
  if (!date) {
    return ''
  }
  var _date = new Date(date);//如果date为13位不需要乘1000
  var Y = _date.getFullYear() + '-';
  var M = (_date.getMonth() + 1 < 10 ? '0' + (_date.getMonth() + 1) : _date.getMonth() + 1) + '-';
  var D = (_date.getDate() < 10 ? '0' + (_date.getDate()) : _date.getDate());
  var h = (_date.getHours() < 10 ? '0' + _date.getHours() : _date.getHours()) + ':';
  var m = (_date.getMinutes() < 10 ? '0' + _date.getMinutes() : _date.getMinutes());
  var s = ':'+(_date.getSeconds() < 10 ? '0' + _date.getSeconds() : _date.getSeconds());
  if (dayOrTime === 'day') {
    return Y + M + D;
  } else if (dayOrTime === 'time') {
    return h + m + s;
  } else if (dayOrTime === 'timeHM') {
    return h + m ;
  } else {
    return Y + M + D + ' ' + h + m + s;
  }
}

//判断案件状态
const checkStatus = (status)=>{
  let str = ""
  switch (status) {
    case '1': str = '未提交'; break;
    case '2': str = '已提交'; break;
    case '3': str = '待安排风控'; break;
    case 'D': str = '风控审核中'; break;
    case '4': str = '风控审核通过'; break;
    case '5': str = '已承接'; break;
    case '0': str = '已关闭'; break;
    case '8': str = '异常结案'; break;
    case '9': str = '已结案'; break;
    case 'A': str = '审核拒绝'; break;
    case 'B': str = '待委托'; break;
    case 'C': str = '已委托'; break;
    case 'E': str = '合同未确认'; break;
    case 'F': str = '合同已确认'; break;
    case 'G': str = '合同已签约'; break;
    case 'H': str = '财务已审核'; break;
    default:
  }
  return str;
}

const dateStr= (input)=> {
  let str = '';
  if (input) {
    str = input.substring(0, 4) + "-" + input.substring(4, 6) + "-" + input.substring(6, 8);
  }
  return str;
}

const timeStr = (input) => {
  let str = '';
  if (input) {
    str = input.substring(0, 2) + ":" + input.substring(2, 4) + ":" + input.substring(4, 6);
  }
  return str;
}
const SYT_util = {
  /**
   * 格式化金额
   *
   * @param money
   *            金额
   * @param accuracy
   *            精度(小数位数)
   * @return 格式化后的金额
   */
  formatMoney: function (money, accuracy) {
    if (money == null || money == "") {
      return money;
    }
    money = money + "";
    var tempValue = money.replace(/\s/g, "");
    var tempArray = null;
    var v = "";
    // 如果为整数
    if (accuracy <= 0) {
      if (tempValue.indexOf(".") != -1) {
        v = tempValue.split(".")[0];
      } else {
        v = tempValue;
      }
    }
    // 如果为小数
    else {
      if (tempValue.indexOf(".") != -1) {
        tempArray = tempValue.split(".");
        v = tempArray[0]
          + "."
          + (tempArray[1] + "00000000000000000").substring(0,
            accuracy);
      } else {
        v = tempValue + "."
          + ("00000000000000000").substring(0, accuracy);
      }
    }
    return v;
  },

  /**
   * 格式化日期
   *
   * @param date
   *            日期
   * @param format
   *            格式化样式,例如yyyy-MM-dd HH:mm:ss E
   * @return 格式化后的金额
   */
  formatDate: function (date, format) {
    var v = "";
    if (typeof date == "string" || typeof date != "object") {
      return;
    }
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    var day = date.getDate();
    var hour = date.getHours();
    var minute = date.getMinutes();
    var second = date.getSeconds();
    var weekDay = date.getDay();
    var ms = date.getMilliseconds();
    var weekDayString = "";

    if (weekDay == 1) {
      weekDayString = "星期一";
    } else if (weekDay == 2) {
      weekDayString = "星期二";
    } else if (weekDay == 3) {
      weekDayString = "星期三";
    } else if (weekDay == 4) {
      weekDayString = "星期四";
    } else if (weekDay == 5) {
      weekDayString = "星期五";
    } else if (weekDay == 6) {
      weekDayString = "星期六";
    } else if (weekDay == 7) {
      weekDayString = "星期日";
    }

    v = format;
    // Year
    v = v.replace(/yyyy/g, year);
    v = v.replace(/YYYY/g, year);
    v = v.replace(/yy/g, (year + "").substring(2, 4));
    v = v.replace(/YY/g, (year + "").substring(2, 4));

    // Month
    var monthStr = ("0" + month);
    v = v.replace(/MM/g, monthStr.substring(monthStr.length - 2));

    // Day
    var dayStr = ("0" + day);
    v = v.replace(/dd/g, dayStr.substring(dayStr.length - 2));

    // hour
    var hourStr = ("0" + hour);
    v = v.replace(/HH/g, hourStr.substring(hourStr.length - 2));
    v = v.replace(/hh/g, hourStr.substring(hourStr.length - 2));

    // minute
    var minuteStr = ("0" + minute);
    v = v.replace(/mm/g, minuteStr.substring(minuteStr.length - 2));

    // Millisecond
    v = v.replace(/sss/g, ms);
    v = v.replace(/SSS/g, ms);

    // second
    var secondStr = ("0" + second);
    v = v.replace(/ss/g, secondStr.substring(secondStr.length - 2));
    v = v.replace(/SS/g, secondStr.substring(secondStr.length - 2));

    // weekDay
    v = v.replace(/E/g, weekDayString);
    return v;
  },

  formatDateTimeString: function (dateTimeString) {
    if (dateTimeString == null || dateTimeString == "") {
      return "";
    }
    dateTimeString = dateTimeString.replace(/ /g, "");
    dateTimeString = dateTimeString.replace(/\-/g, "");
    dateTimeString = dateTimeString.replace(/\:/g, "");
    var year = dateTimeString.substring(0, 4);
    var month = dateTimeString.substring(4, 6);
    var day = dateTimeString.substring(6, 8);
    var hour = dateTimeString.substring(8, 10);
    var minute = dateTimeString.substring(10, 12);
    var second = dateTimeString.substring(12, 14);

    var newString = "";
    if (year != "") {
      newString += year;
    }
    if (month != "") {
      newString += "-" + month;
    }
    if (day != "") {
      newString += "-" + day;
    }
    if (hour != "") {
      newString += " " + hour;
    }
    if (minute != "") {
      newString += ":" + minute;
    }
    if (second != "") {
      newString += ":" + second;
    }
    return newString;
  },

  formatDateToString: function () {
    var myDate = new Date();
    var month = myDate.getMonth() * 1 + 1;
    if (month < 10) {
      month = "0" + month;
    }
    var dateString = myDate.getFullYear() + "" + month + "" + myDate.getDate() + "" + myDate.getHours() + "" + "0000";
    return dateString;
  },

  /**
   * 转化日期
   *
   * @param dependedVal
   *            string 日期 yyyy-MM-dd
   * @return date
   */
  datestrToDate: function (dependedVal) {
    var regEx = new RegExp("\\-", "gi");
    dependedVal = dependedVal.replace(regEx, "/");
    var milliseconds = Date.parse(dependedVal);
    var dependedDate = new Date();
    dependedDate.setTime(milliseconds);
    return dependedDate;
  },

  /**
   * 比较两日期大小
   *
   * @param dependedVal
   * string 日期 yyyy-MM-dd
   * startData
   * endData
   * @return boolean
   */
  compareDate: function (startData, endData) {
    var startTime = startData.replace(/-/g, "/");
    var endTime = endData.replace(/-/g, "/");
    var d1 = new Date(Date.parse(startTime));
    var d2 = new Date(Date.parse(endTime));
    if (d1 > d2) {
      return false;
    } else {
      return true;
    }
  },


  /**
   * 验证是手机号是否有效
   * @param mobileNo 充值手机号
   * @return boolean true
   */
  isValidNo: function (mobileNo) {
    var v = false;
    if (mobileNo == null || mobileNo == "" || mobileNo.length != 11) {
      return false;
    }
    //		var mobileHead = mobileNo.substr(0,3);
    //		var headArray = new Array(134,135,136,137,138,139,150,151,152,157,158,159,182,183,187,188,147,130,131,132,155,156,185,186,133,153,180,189,181);
    //        for(var i=0;i<headArray.length;i++){
    //           if(headArray[i] == mobileHead) {
    //              v = true;
    //              break;
    //           }
    //        }
    var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(18[0-9]{1})|(14[0-9]{1}))+\d{8})$/;
    if (myreg.test(mobileNo)) {
      v = true;
    }
    return v;
  },

  /*
  用途：检查输入字符串是否只由汉字、字母组成
  输入：
  value：字符串
  返回：
  如果通过验证返回true,否则返回false
  */
  //判断姓名是否是汉字、字母组成
  isChinaOrLett: function (s) {
    var flag;
    var regu = "^[a-zA-Z\u4e00-\u9fa5]+$";
    var re = new RegExp(regu);
    if (re.test(s)) {
      flag = true;
    } else {
      flag = false;
    }
    return flag;
  },

  //1.js验证只能输入6位数字.
  checkSixCode: function (value) {
    var flag = false;
    //定义正则表达式部分
    if (value == null || value == "" || value.length != 6) {
      return false;
    }
    if (/^[0-9]*$/.test(value * 1)) {
      flag = true;
    }
    return flag;
  },

  math: {
    // 加法精确计算(可传负数做减法计算)
    accAdd: function (arg1, arg2) {
      var r1, r2, m, c;
      try {
        r1 = arg1.toString().split(".")[1].length;
      } catch (e) {
        r1 = 0;
      }
      try {
        r2 = arg2.toString().split(".")[1].length;
      } catch (e) {
        r2 = 0;
      }

      c = Math.abs(r1 - r2);
      m = Math.pow(10, Math.max(r1, r2))
      if (c > 0) {
        var cm = Math.pow(10, c);
        if (r1 > r2) {
          arg1 = Number(arg1.toString().replace(".", ""));
          arg2 = Number(arg2.toString().replace(".", "")) * cm;
        } else {
          arg1 = Number(arg1.toString().replace(".", "")) * cm;
          arg2 = Number(arg2.toString().replace(".", ""));
        }
      } else {
        arg1 = Number(arg1.toString().replace(".", ""));
        arg2 = Number(arg2.toString().replace(".", ""));
      }
      return (arg1 + arg2) / m;

    },

    // 减精确计算
    accSub: function (arg1, arg2) {
      var r1, r2, m, c;
      try {
        r1 = arg1.toString().split(".")[1].length;
      } catch (e) {
        r1 = 0;
      }
      try {
        r2 = arg2.toString().split(".")[1].length;
      } catch (e) {
        r2 = 0;
      }

      c = Math.abs(r1 - r2);
      m = Math.pow(10, Math.max(r1, r2))
      if (c > 0) {
        var cm = Math.pow(10, c);
        if (r1 > r2) {
          arg1 = Number(arg1.toString().replace(".", ""));
          arg2 = Number(arg2.toString().replace(".", "")) * cm;
        } else {
          arg1 = Number(arg1.toString().replace(".", "")) * cm;
          arg2 = Number(arg2.toString().replace(".", ""));
        }
      } else {
        arg1 = Number(arg1.toString().replace(".", ""));
        arg2 = Number(arg2.toString().replace(".", ""));
      }
      return (arg1 - arg2) / m;

    },

    // 乘法精确计算
    accMul: function (arg1, arg2) {
      var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
      try {
        m += s1.split(".")[1].length;
      } catch (e) {
      }
      try {
        m += s2.split(".")[1].length;
      } catch (e) {
      }
      return Number(s1.replace(".", "")) * Number(s2.replace(".", ""))
        / Math.pow(10, m);

    },

    // 除法函数，用来得到精确的除法结果
    accDiv: function (arg1, arg2) {
      var t1 = 0, t2 = 0, r1, r2;
      try {
        t1 = arg1.toString().split(".")[1].length;
      } catch (e) {
      }
      try {
        t2 = arg2.toString().split(".")[1].length;
      } catch (e) {
      }
      r1 = Number(arg1.toString().replace(".", ""));
      r2 = Number(arg2.toString().replace(".", ""));
      return (r1 / r2) * Math.pow(10, t2 - t1);
    }
  },

  /**
   * 根据身份证还判断年龄性别以及年龄段（青年：40岁以下,中年：41-65岁,老年:66岁以上）
   * @param idNo 身份证号
   */
  analysisId: function (val) {
    if (val == "" || val == null || val == 'undefined') {
      return "";
    }
    var birthdayValue;
    var sexual;
    if (15 == val.length) { //15位身份证号码
      birthdayValue = val.charAt(6) + val.charAt(7);
      if (parseInt(birthdayValue) < 10) {
        birthdayValue = '20' + birthdayValue;
      } else {
        birthdayValue = '19' + birthdayValue;
      }
      birthdayValue = birthdayValue + '-' + val.charAt(8) + val.charAt(9) + '-' + val.charAt(10) + val.charAt(11);
      if (parseInt(val.charAt(14) / 2) * 2 != val.charAt(14)) {
        sexual = 'man';
      } else {
        sexual = 'woman';
      }
    }
    if (18 == val.length) { //18位身份证号码
      birthdayValue = val.charAt(6) + val.charAt(7) + val.charAt(8) + val.charAt(9) + '-' + val.charAt(10) + val.charAt(11) + '-' + val.charAt(12) + val.charAt(13);
      if (parseInt(val.charAt(16) / 2) * 2 != val.charAt(16)) {
        sexual = 'man';
      } else {
        sexual = 'woman';
      }
    }
    var ageGroup = this.ageGroups(birthdayValue);
    var returnData = {};
    returnData.sex = sexual;
    returnData.type = ageGroup;

    return returnData;
  },

  ageGroups: function (str) {
    //获取年龄
    var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
    var age, ageGroup;
    if (r == null) {
      return false;
    }
    var d = new Date(r[1], r[3] - 1, r[4]);
    if (d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] && d.getDate() == r[4]) {
      var Y = new Date().getFullYear();
      age = Y - r[1];
    }
    //年龄段
    if (age <= 40) {
      ageGroup = 'young';
    } else if (age >= 66) {
      ageGroup = 'old';
    } else {
      ageGroup = 'middleAge';
    }
    return ageGroup;
  },

  getRad: function (d) {
    return d * Math.PI / 180.0;
  },

  /**
   * 经纬度距离计算
   * caculate the great circle distance
   * @param {Object} lat1
   * @param {Object} lng1
   * @param {Object} lat2
   * @param {Object} lng2
   */
  getGreatCircleDistance: function (lat1, lng1, lat2, lng2) {
    var EARTH_RADIUS = 6378137;    //单位米

    var radLat1 = this.getRad(lat1);
    var radLat2 = this.getRad(lat2);

    var a = radLat1 - radLat2;
    var b = this.getRad(lng1) - this.getRad(lng2);

    var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
    s = s * EARTH_RADIUS;
    s = Math.round(s * 10000) / 10000.0;

    return s;
  },
  distanceTwoDay: function (start, end) {
    return Math.floor(Math.abs((start.getTime() - end.getTime())) / (1000 * 60 * 60 * 24)) + 1;
  }
}

const getDocIconImg = (input) => {
  let str = '';
  if (/.doc$/.test(input) || /.docx$/.test(input)) {
    str = 'file_word';
  } else if (/.xls$/.test(input) || /.xlsx$/.test(input)) {
    str = 'file_exl';
  } else if (/.zip$/.test(input)) {
    str = 'file_zip'
  } else if (/.png$/.test(input)) {
    str = 'file_png';
  } else if (/.exe$/.test(input)) {
    str = 'file_exe'
  } else if (/.gif$/.test(input)) {
    str = 'file_gif'
  } else if (/.jpg$/.test(input) || /.jpeg$/.test(input)) {
    str = 'file_jpg';
  } else if (/.ios$/.test(input)) {
    str = 'file_ios'
  } else if (/.pdf$/.test(input)) {
    str = 'file_pdf';
  } else if (/.ppt$/.test(input) || /.pptx$/.test(input)) {
    str = 'file_ppt';
  } else if (/.txt$/.test(input)) {
    str = 'file_txt';
  } else {
    str = 'file_other'
  }
  return str;
}
const getDocCanOpen = (input) => {
  let str = false;
  if (/.doc$/.test(input) || /.docx$/.test(input)) {
    str =true;
  } else if (/.xls$/.test(input) || /.xlsx$/.test(input)) {
    str = true;
  } else if (/.zip$/.test(input)) {
  } else if (/.png$/.test(input)) {
    str = true;
  } else if (/.exe$/.test(input)) {
  } else if (/.gif$/.test(input)) {
  } else if (/.jpg$/.test(input) || /.jpeg$/.test(input)) {
    str = true;
  } else if (/.ios$/.test(input)) {
  } else if (/.pdf$/.test(input)) {
    str = true;
  } else if (/.ppt$/.test(input) || /.pptx$/.test(input)) {
    str = true;
  } else if (/.txt$/.test(input)) {
  } else {
  }
  return str;
}
const filter={
  signStatus : (input) => {
    let str = '';
    if (input) {
      switch (input + '') {
        case '1': str = '已签到，拜访中'; break;
        case '2': str = '已签退'; break;
        case '3': str = '未签退'; break;
        default:
      }
    }
    return str;
  },
  signReason : (input) => {
    let str = '';
    if (input) {
      switch (input + '') {
        case '1': str = '新客户拜访'; break;
        case '2': str = '回访'; break;
        case '3': str = '上门咨询服务'; break;
        default:
      }
    }
    return str;
  },
  getWeek: (input) => {
    let str = '';
    if (input) {
      let _date = new Date(input);//如果date为13位不需要乘1000
      let W = _date.getDay();
      if (W==0){
        str='周日'
      } else if (W == 1) {
        str = '周一'
      } else if (W == 2) {
        str = '周二'
      } else if (W == 3) {
        str = '周三'
      } else if (W ==4) {
        str = '周四'
      } else if (W == 5) {
        str = '周五'
      } else if (W == 6) {
        str = '周六'
      }
    }
    return str;
  },
  getTimeLength: (input) => {//单位 ： 秒
    let str = '';
    if (input) {
      let second = input*1, minute = 0, hour = 0, day = 0;
      minute = parseInt(second / 60); //算出一共有多少分钟
      second %= 60;//算出有多少秒
      if (minute > 60) { //如果分钟大于60，计算出小时和分钟
        hour = parseInt(minute / 60);
        minute %= 60;//算出有多分钟
      }
      if (hour > 24) {//如果小时大于24，计算出天和小时
        day = parseInt(hour / 24);
        hour %= 24;//算出有多分钟
      }
      if (minute > 0) {
        str = minute + '分钟'
      } else {
        str = '1分钟'
      }
      if (hour>0){
        str = hour + '小时' + minute + '分钟'
      }
      if (day>0){
        str = day + '天' + hour + '小时' + minute+'分钟'
      }
    }
    return str;
  },
  dateNum: (input) => {//单位 ： 秒
    let str = '';
    if (input) {
      let startDate = new Date(input);
      let startDateAdd1 = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate()+1)
      let endDate = new Date();
      if (startDate.getFullYear() == endDate.getFullYear() && startDate.getMonth() == endDate.getMonth() && startDate.getDate() == endDate.getDate()){
        str='今天'
      } else if (startDateAdd1.getFullYear() == endDate.getFullYear() && startDateAdd1.getMonth() == endDate.getMonth() && startDateAdd1.getDate() == endDate.getDate()) {
        str = '昨天'
      }else{
        str = timetrans(input,'day')
      }
    }
    return str;
  },
  getStatusStr:function (slt, con) {
    let str = '';
    if (slt === '案件') {
      switch (con) {
        case '未提交': str = '1'; break;
        case '已提交': str = '2'; break;
        case '待安排风控': str = '3'; break;
        case '风控审核中': str = 'D'; break;
        case '风控审核通过': str = '4'; break;
        case '已承接': str = '5'; break;
        case '已关闭': str = '0'; break;
        case '异常结案': str = '8'; break;
        case '已结案': str = '9'; break;
        case '审核拒绝': str = 'A'; break;
        case '待委托': str = 'B'; break;
        case '已委托': str = 'C'; break;
        case '合同未确认': str = 'E'; break;
        case '合同已确认': str = 'F'; break;
        case '合同已签约': str = 'G'; break;
        case '财务已审核': str = 'H'; break;
        default:
      }
    } else if (slt === '风险投') {
      switch (con) {
        case '合同未确认': str = '1'; break;
        case '合同已确认': str = '2'; break;
        case '合同已签约': str = '3'; break;
        case '财务已审核': str = '4'; break;
        case '财务已放款': str = '5'; break;
        case '部分已回款': str = '6'; break;
        case '已关闭': str = '0'; break;
        case '审核拒绝': str = 'A'; break;
        default:
      }
    }
    return str;
  }
}
module.exports = {
  formatTime: formatTime,
  formatDate: formatDate,
  sortByTime: sortByTime,
  timetrans: timetrans,
  fChkMail: fChkMail,
  checkStatus: checkStatus,
  dateStr: dateStr,
  timeStr: timeStr,
  isValidNo: isValidNo,
  filterFormatAmt: filterFormatAmt,
  SYT_util: SYT_util,
  getDocIconImg: getDocIconImg,
  getDocCanOpen: getDocCanOpen,
  filter: filter
}
